package ma.cdm.compteRendu.bo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Comite entity. @author Limouri Anouar
 */
@Entity
@Table(name="comite")

public class Comite  implements java.io.Serializable {

	// Fields

	private Long idcomite;
	private String libellecomite;
	private String descriptioncomite;
	private Set<PersonneRole> personneroles = new HashSet<PersonneRole>(0);
	private Set<CompteRendu> compterendus = new HashSet<CompteRendu>(0);

	// Constructors

	/** default constructor */
	public Comite() {
	}

	/** full constructor */
	public Comite(String libellecomite, String descriptioncomite,
			Set<PersonneRole> personneroles, Set<CompteRendu> compterendus) {
		this.libellecomite = libellecomite;
		this.descriptioncomite = descriptioncomite;
		this.personneroles = personneroles;
		this.compterendus = compterendus;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "IDCOMITE", unique = true, nullable = false)
	public Long getIdcomite() {
		return this.idcomite;
	}

	public void setIdcomite(Long idcomite) {
		this.idcomite = idcomite;
	}

	@Column(name = "LIBELLECOMITE", length = 500)
	public String getLibellecomite() {
		return this.libellecomite;
	}

	public void setLibellecomite(String libellecomite) {
		this.libellecomite = libellecomite;
	}

	@Column(name = "DESCRIPTIONCOMITE", length = 2000)
	public String getDescriptioncomite() {
		return this.descriptioncomite;
	}

	public void setDescriptioncomite(String descriptioncomite) {
		this.descriptioncomite = descriptioncomite;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "comite")
	public Set<PersonneRole> getPersonneroles() {
		return this.personneroles;
	}

	public void setPersonneroles(Set<PersonneRole> personneroles) {
		this.personneroles = personneroles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "comite")
	public Set<CompteRendu> getCompterendus() {
		return this.compterendus;
	}

	public void setCompterendus(Set<CompteRendu> compterendus) {
		this.compterendus = compterendus;
	}

}